import java.io.Serializable;

public class BankAccount implements Serializable {

    private String account; // 账户

    private double balance; // 余额

    // 进账
    public void in(double money) {
//        this.balance = this.balance + money;
        this.balance += money;
    }

    // 出账
    public void out(double money) {
        this.balance -= money;
    }

    // 定义一个无参构造器
    public BankAccount() {

    }

    // 有参构造器
    public BankAccount(String account, double balance) {
        this.balance = balance;
        this.account = account;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "BankAccount{" +
                "account='" + account + '\'' +
                ", balance=" + balance +
                '}';
    }
}
